<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>创建数组</title>
</head>

<body>
    <script>
        var i;
        var mycars = new Array();
        mycars[0] = "Saab";
        mycars[1] = "Volvo";
        mycars[2] = "BMW";
        for (i = 0; i < mycars.length; i++) {
            document.write(mycars[i] + "<br />");
        }
    </script>
</body>

</html>